//
//  NSString+EncodingData.m
//  iOSInterview
//
//  Created by macbook on 2025/5/30.
//

#import "NSString+EncodingData.h"

@implementation NSString (EncodingData)

- (NSString *)encodingData:(NSData *)data {
    NSString *encodingString = [self initWithData:data encoding:NSUTF8StringEncoding];
    if (encodingString.length >= 2 && [encodingString hasPrefix:@"\""] && [encodingString hasSuffix:@"\""]) {
        encodingString = [encodingString substringWithRange:NSMakeRange(1, encodingString.length - 2)];
    }
    return encodingString;
}

@end
